package com.chanyachting.emall.util;

import java.util.Iterator;
import java.util.Map;
import java.util.TreeMap;

public class CodeMap {
	
	
	
	/**
	 * 广告类型
	 */
	public static final Map adType = new TreeMap();
	static {
		
		adType.put("01", "纯图片");
		adType.put("02", "纯文字/脚本");
		adType.put("03", "图片加文字/脚本");
	}
	
	
	
	
	/**
	 * 管理员类型
	 */
	public static final Map adminType = new TreeMap();
	static {
		
		adminType.put("01", "战略管理员");
		adminType.put("02", "模块管理员");
	}
	
	
	
	//杂志类型
	public static final Map magazineType = new TreeMap();
	static {
		
		magazineType.put("01", "中华游艇");
		magazineType.put("02", "游艇杂志");
	}
	
	
	
	//码头俱乐部类型
	public static final Map dockType = new TreeMap();
	static {
		
		dockType.put("01", "新泊销售");
		dockType.put("02", "泊位出租");
		dockType.put("03", "泊位销售");
		dockType.put("04", "新会籍销售");
		dockType.put("05", "二手会籍销售");
		
	}
	
	
	
	//游艇码头设施
	public static final Map facilities = new TreeMap();
	static {
		
		facilities.put("01", "维护保养");
		facilities.put("02", "下水坡道");
		facilities.put("03", "搬用设施");
		facilities.put("04", "电源");
		facilities.put("05", "冬季贮藏");
		
		facilities.put("06", "航海配件商店");
		facilities.put("07", "汽油");
		facilities.put("08", "柴油");
		facilities.put("09", "水");
		facilities.put("10", "污水污油处理");
		facilities.put("11", "豪华游艇设施");
		
		
	}
	
	
	//便利和旅游设施
	public static final Map convienience = new TreeMap();
	static {
		
		convienience.put("01", "综合商店");
		convienience.put("02", "航海商店");
		convienience.put("03", "淋浴");
		convienience.put("04", "公厕");
		convienience.put("05", "客房出租");
		convienience.put("06", "餐馆");
		
		convienience.put("07", "游泳池");
		convienience.put("08", "无线网络");
		convienience.put("09", "有线电视");
		convienience.put("10", "旅游景点");
		convienience.put("11", "露营地");
		convienience.put("12", "钓鱼点");
		
	}
	
	
	
	//公司产品类型
	public static final Map companyProductType = new TreeMap();
	static {
		
		companyProductType.put("00", "基本类型");   //
		companyProductType.put("01", "游艇销售");   
		companyProductType.put("02", "游艇出租");
		companyProductType.put("03", "码头俱乐部");
		companyProductType.put("04", "游艇展览");
		companyProductType.put("05", "帆船赛事");
		companyProductType.put("06", "新闻活动");
		companyProductType.put("07", "个人求职");
		companyProductType.put("08", "公司招聘");
		
		
	}
	
	
	
	//游艇类别（后台设置游艇类别，前台游艇搜索条件）
	
	public static final Map yachtType = new TreeMap();
	static {
		
		yachtType.put("01", "动力艇");
		yachtType.put("02", "帆船");
		yachtType.put("03", "帆板和水上运动");
		yachtType.put("04", "其它");
		
	}
	
	

	
	//公司性质
	public static final Map companyType = new TreeMap();
	static {
		companyType.put("01", "私营公司");
		companyType.put("02", "上市/股份公司");
		companyType.put("03", "外资公司（含港、澳、台） ");
		companyType.put("04", "外企代表处");
		
		companyType.put("04", "国有公司");
		companyType.put("05", "合资公司");
		companyType.put("06", "海外机构");
		companyType.put("07", "其它性质");
		
	}
	
	
	//公司雇员数量范围
	public static final Map employeeNumber = new TreeMap();
	static {
		employeeNumber.put("01", "1-20");
		employeeNumber.put("02", "21-50");
		employeeNumber.put("03", "51-100");
		employeeNumber.put("04", "101-500");
		employeeNumber.put("05", "500以上");
		
	}
	
	
	//
	
	
	
	//国家
	public static final Map state = new TreeMap();
	static {
		state.put("01", "中国      ");
		state.put("02", "美国      ");
		state.put("03", "英国      ");
		state.put("04", "法国      ");
		state.put("05", "德国      ");
		state.put("06", "意大利    ");
		state.put("07", "日本      ");
		state.put("08", "泰国	     ");
		state.put("09", "韩国      ");
		state.put("10", "澳大利亚  ");
		state.put("11", "克罗地亚  ");
		state.put("12", "西班牙    ");
		state.put("13", "加拿大    ");
		state.put("14", "俄罗斯    ");
		state.put("15", "新西兰    ");
		state.put("16", "荷兰      ");
		state.put("17", "瑞典      ");
		state.put("18", "瑞士      ");
		state.put("19", "奥地利    ");
		state.put("20", "阿根廷    ");
		state.put("21", "比利时    ");
		state.put("22", "挪威      ");
		state.put("23", "波兰      ");
		state.put("24", "丹麦      ");
		state.put("25", "芬兰      ");
		state.put("26", "奥地利    ");
		state.put("27", "希腊      ");
		state.put("28", "墨西哥    ");
		state.put("29", "巴西      ");
		state.put("30", "南非      ");
		state.put("31", "土耳其    ");
		state.put("32", "保加利亚  ");
		state.put("33", "捷克共和国");
		state.put("34", "匈牙利    ");
		state.put("35", "以色列    ");

	}
	
	

	//证件类型
	public static final Map IDType = new TreeMap();
	static {
		IDType.put("01", "身份证");
		IDType.put("02", "军官证");
		IDType.put("03", "社保号码");
		IDType.put("04", "其他");
		
	}
	
	
	
	//外语种类
	public static final Map fLanguage = new TreeMap();
	static {
		fLanguage.put("01", "英语");
		fLanguage.put("02", "日语");
		fLanguage.put("03", "法语");
		fLanguage.put("04", "德语");
		fLanguage.put("05", "俄语");
		fLanguage.put("06", "汉语");
	}
	
	
	
	//英语等级 
	public static final Map englishlevel = new TreeMap();
	static {
		englishlevel.put("01", "二级");
		englishlevel.put("02", "四级");
		englishlevel.put("03", "六级");
		englishlevel.put("04", "专业八级");
		
	}
	
	
	//程度-等级
	public static final Map level = new TreeMap();
	static {
		level.put("01", "差");
		level.put("02", "中");
		level.put("03", "良");
		level.put("04", "优");
		
	}
	
	
	//省份
	public static final Map city = new TreeMap();
	static {
		city.put("01","北京市");
		city.put("02","天津市");
		city.put("03","河北省");
		city.put("04","山西省");
		city.put("05","内蒙古");
		city.put("06","辽宁省");
		city.put("07","吉林省");
		city.put("08","黑龙江省");
		city.put("09","上海市");
		city.put("10"," 江苏省");
		city.put("11","浙江省");
		city.put("12","安徽省");
		city.put("13","福建省");
		city.put("14","江西省");
		city.put("15","山东省");
		city.put("16","河南省");
		city.put("17","湖北省");
		city.put("18","湖南省");
		city.put("19","广东省");
		city.put("20","广西自治区");
		city.put("21","海南 省");
		city.put("22","重庆市");
		city.put("23","四川省");
		city.put("24","贵州省");
		city.put("25","云南省");
		city.put("26","西藏自治区");
		city.put("27","陕西省");
		city.put("28","甘肃省");
		city.put("29","青海省");
		city.put("30","宁夏回族自治区");
		city.put("31","新疆维吾尔自治区");
		city.put("32","香港特别行政区");
		city.put("33","澳门特别行政区");
		city.put("34","台湾省");
		city.put("35","其它");
	}
	
	
	//工作意向地区
	public static final Map toJobArea = new TreeMap();
	static {
		toJobArea.put("01", "上海");
		toJobArea.put("02", "北京");
		toJobArea.put("03", "广州");
		toJobArea.put("04", "深圳");
		toJobArea.put("05", "成都");
		toJobArea.put("06", "重庆");
	}
	
	
	
	// 月收入
	public static final Map income = new TreeMap();
	static {
		income.put("00", "面议");
		income.put("01", "1000-1999");
		income.put("02", "2000-2999");
		income.put("03", "3000-4999");
		income.put("04", "5000-6999");
		income.put("05", "7000-9999");
		income.put("06", "10000-29999");
		income.put("07", "30000-49999");
		income.put("99", "50000及以上");
	}

	
	
	
	//求职类型
	public static final Map toJobType = new TreeMap();
	static {
		toJobType.put("01", "全职");
		toJobType.put("02", "兼职");
	}

	
	// 性别
	public static final Map sex = new TreeMap();
	static {
		sex.put("01", "男");
		sex.put("02", "女");
	}
	
	
	
	// 婚姻状况
	public static final Map marriage = new TreeMap();
	static {
		marriage.put("1", "未婚");
		marriage.put("2", "已婚");
	}

	
	//工作岗位类型 
	public static final Map jobTypeBack = new TreeMap();
	static {
		jobTypeBack.put("01", "游艇船员：  游艇船长 帆船船长 船员");
		jobTypeBack.put("02", "豪华游艇服务：  船长 船长助理  船员  水手 服务人员/管家  按摩/美容治疗师");
		jobTypeBack.put("03", "游艇厨师/厨师助理");
		jobTypeBack.put("04", "设计/工程：  船艇工程师  船艇设计师 其它工程师 其它设计师");
		jobTypeBack.put("05", "技工/质检：  船艇技工 船艇设备/配件技工 其它技工");
		jobTypeBack.put("06", "市场营销");
		jobTypeBack.put("07", "高级管理");
		jobTypeBack.put("08", "行政/后勤/客服");
		jobTypeBack.put("09", "其它");
	}
	
	
	public static final Map jobType = new TreeMap();
	static {
		jobType.put("01", "游艇船员");
		jobType.put("02", "豪华游艇服务");
		jobType.put("03", "游艇厨师/厨师助理");
		jobType.put("04", "设计/工程");
		jobType.put("05", "技工/质检");
		jobType.put("06", "市场营销");
		jobType.put("07", "高级管理");
		jobType.put("08", "行政/后勤/客服");
		jobType.put("09", "其它");
	}
	
	
	//行业性质
	public static final Map businessType = new TreeMap();
	static {
		
		businessType.put("01", "船艇制造");
		businessType.put("02", "船艇贸易");
		businessType.put("03", "设备/配件制造");
		businessType.put("04", "设备/配件贸易");
		businessType.put("05", "引擎制造");
		businessType.put("06", "引擎贸易");
		businessType.put("07", "游艇服务");
	}
	
	
	//工作年限
	public static final Map injobTime = new TreeMap();
	static {
		
		injobTime.put("01", "应届毕业生");
		injobTime.put("02", "一年以上");
		injobTime.put("03", "二年以上");
		injobTime.put("04", "三年以上");
		injobTime.put("05", "五年以上");
	}
	
	
	
	//学历
	public static final Map edu = new TreeMap();
	static {
		edu.put("01", "小学");
		edu.put("02", "初中");
		edu.put("03", "高中");
		edu.put("04", "专科");
		edu.put("05", "本科");
		edu.put("06", "硕士");
		edu.put("07", "博士");
		edu.put("08", "其他");
	}

	//频道类型
	public static final Map channelType = new TreeMap();
	static {
		channelType.put("01", "新闻活动");
		channelType.put("02", "游艇销售");
		channelType.put("03", "游艇租赁");
		channelType.put("04", "码头俱乐部");
		channelType.put("05", "招聘求职");
		channelType.put("06", "展览赛事");
		channelType.put("07", "游艇黄页");
	}
	
	public static final Map areaType = new TreeMap();
	static {
		areaType.put("01", "华北-东北");
		areaType.put("02", "华东地区");
		areaType.put("03", "华南-华中");
		areaType.put("04", "西北-西南");
		areaType.put("05", "其它");
		
	}
	
	public static final Map isNoJob = new TreeMap();
	static {
		isNoJob.put("01", "离职");
		isNoJob.put("02", "在职");
		isNoJob.put("03", "应届生");
	}
	
	public static final Map publicationType = new TreeMap();
	static {
		publicationType.put("01", "已发布");
		publicationType.put("00", "待发布");
	}
	
	public static final Map saleProductType = new TreeMap();
	static {
		saleProductType.put("89", "二手游艇");
		saleProductType.put("90", "新艇");
		saleProductType.put("91", "超级游艇");
		saleProductType.put("8", "豪华游艇");
	}
	public static final Map rentProductType = new TreeMap();
	static {
		rentProductType.put("92", "机动艇");
		rentProductType.put("93", "帆船");
		rentProductType.put("94", "超级游艇");
		rentProductType.put("95", "双体船");
		rentProductType.put("96", "其它船艇");
	}
	
	public static String getDockTypeByKey(String key) {
		return NulltoStr(dockType,key);
	}
	
	public static String getSaleTypeByKey(String key) {
		return NulltoStr(saleProductType,key);
	}
	
	public static String getRentTypeByKey(String key) {
		return NulltoStr(rentProductType,key);
	}
	
	public static String getEduNameByKey(String key) {
		return NulltoStr(edu,key);
	}
	
	public static String getCompanyTypeByKey(String key) {
		return NulltoStr(companyType,key);
	}
	
	public static String getStateByKey(String key) {
		return NulltoStr(state,key);
	}
	
	public static String getJobTypeByKey(String key) {
		return NulltoStr(jobType,key);
	}
	
	public static String getSexByKey(String key) {
		return NulltoStr(sex,key);
	}
	
	public static String getToJobAreaByKey(String key) {
		return NulltoStr(toJobArea,key);
	}
	
	public static String getToJobTypeByKey(String key) {
		return NulltoStr(toJobType,key);
	}
	
	public static String getInjobTimeByKey(String key) {
		return NulltoStr(injobTime,key);
	}
	
	public static String getIDTypeByKey(String key) {
		return NulltoStr(IDType,key);
	}
	
	public static String getMarriageByKey(String key) {
		return NulltoStr(marriage,key);
	}
	
	public static String getBusinessTypeByKey(String key) {
		return NulltoStr(businessType,key);
	}
	
	public static String getIsNoJobByKey(String key) {
		return NulltoStr(isNoJob,key);
	}
	
	public static String getFLanguageByKey(String key) {
		return NulltoStr(fLanguage,key);
	}
	
	public static String getLevelByKey(String key) {
		return NulltoStr(level,key);
	}
	
	public static String getEnglishlevelByKey(String key) {
		return NulltoStr(englishlevel,key);
	}
	
	public static String getPublicationTypeByKey(String key) {
		return NulltoStr(publicationType,key);
	}
	
	public static String getCityByKey(String key) {
		return NulltoStr(city,key);
	}
	
	public static String NulltoStr(Map m,String key) {
		if (isDigit(key)) {
			Iterator mIt = m.keySet().iterator();
	          
	        while(mIt.hasNext()){
	        	if (key.equals(mIt.next().toString())) {
	        		return m.get(key).toString();
	        	}
	        }
		}
		
		return key;
	}
	
	public static boolean isDigit(String str) {
		if (str == null) {
			return false;
		}
		try {
			Integer.parseInt(str);
		} catch(Exception e) {
			return false;
		}
		return true;
	}
}
